package bizlogic;

import java.util.ArrayList;

import model.HolidayCalendarDTO;
import exception.DAOSystemException;
import dao.DAOFactory;
import dao.HolidayCalendarDAO;


public class HolidayCalendarManager1 {
	private HolidayCalendarDAO holidayCalendarDAO;
	public HolidayCalendarManager1() {
		holidayCalendarDAO = DAOFactory.loadInstance().getHolidayCalendarDAO();
	}
	
	@SuppressWarnings("finally")
	public HolidayCalendarDTO findHolidayCalendar(String id){
		HolidayCalendarDTO currentHolidayCalendar = new HolidayCalendarDTO();
		try {
			currentHolidayCalendar = holidayCalendarDAO.findHolidayCalendar(id);
		} catch (DAOSystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally
		{
			return currentHolidayCalendar;
		}
		
	}
    @SuppressWarnings("finally")
	public ArrayList<HolidayCalendarDTO> findAllHolidayCalendar() {
    	ArrayList<HolidayCalendarDTO> currentList = new ArrayList<HolidayCalendarDTO>();
		try {
			currentList = holidayCalendarDAO.findAllHolidayCalendars();
		} catch (DAOSystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally
		{
			return currentList;
		}
    }
    public void insertHolidayCalendar(HolidayCalendarDTO holidayCalendar) {
    	try {
    		holidayCalendarDAO.insertHolidayCalendar(holidayCalendar);
		} catch (DAOSystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    public void updateHolidayCalendar(HolidayCalendarDTO holidayCalendar) {
    	try {
    		holidayCalendarDAO.updateHolidayCalendar(holidayCalendar);
		} catch (DAOSystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    public void deleteHolidayCalendar(HolidayCalendarDTO holidayCalendar) {
    	try {
    		holidayCalendarDAO.deleteHolidayCalendar(holidayCalendar);
		} catch (DAOSystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
}
